package hmvictor.jpql;

import java.io.File;

/**
 *
 * @author Victor
 */
public class AppFiles {
    private static final String APP_DIR = ".jpqlstudio";

    public static File getAndCreateConfigDir() {
        File configDir = new File(System.getProperty("user.home"), APP_DIR);
        if(!configDir.exists()){
            boolean created = configDir.mkdir();
            if(!created){
                throw new IllegalStateException("Config dir can not be created");
            }
        }
        return configDir;
    }
    
}
